#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

typedef struct BTNode BTNode;
struct BTNode {
    int val;
    struct BTNode* left;
    struct BTNode* right;
};

BTNode* BinaryTreeCreate(char* a, int* pi)
{
    if (a[*pi] == '#')
    {
        (*pi)++;
        return NULL;
    }
    BTNode* root = (BTNode*)malloc(sizeof(BTNode));
    root->val = a[(*pi)++];
    root->left = BinaryTreeCreate(a, pi);
    root->right = BinaryTreeCreate(a, pi);
    return root;
}

BTNode* Inodrder(BTNode* root)
{
    if (root == NULL)
        return NULL;
    Inodrder(root->left);
    printf("%c", root->val);
    Inodrder(root->right);
    return root;
}

int main() {
    char arr[100];
    scanf("%s", arr);
    int i = 0;
    BTNode* tree = BinaryTreeCreate(arr, &i);
    Inodrder(tree);
    return 0;
}